<?php
/**
 * 会议
 * Created by PhpStorm.
 * User: wym
 * Date: 16/5/17
 * Time: 下午3:40
 */

class ConferenceController extends BaseController {

    function __construct($m = DEFAULT_CONTROLLER, $a = DEFAULT_METHOD) {
        parent::__construct($m, $a);

        $this->redirectToWeixinForOpenid();
    }

    const 爱贝介绍微信文章URL = "https://mp.weixin.qq.com/s?__biz=MzI3NjE2OTU3NA==&mid=403902577&idx=1&sn=153a3ede424f16e8586dc33d5b3fab8a&scene=0&previewkey=eApt5HNBZqOZzDiMbGw5F8wqSljwj2bfCUaCyDofEow%3D&uin=MTA0NzE0MzE2MA%3D%3D&key=f5c31ae61525f82ee0784ef54f6fa83929b078fbe3766b5ccd10089163b0ec478f0b786936f782839c43409d58dbc732&devicetype=iMac+MacBookPro11%2C2+OSX+OSX+10.10.2+build%2814C109%29&version=11020201&lang=zh_CN&pass_ticket=jOLU0Pq0xtikzhH0zquy7AOGsYc65tnHPfEcgrmNDpEEu8rhmjFptnuZWX1Ntmpu";

    //爱会议的列表页
    function index() {
        $mo = new Do会议表();
        $state=array();
        $url_huiwu_list=$this->url('conference','common_huiwu_homepage');
        $url_weiyuanhui_list=$this->url('conference',"xinshenger_index");

        $mo->set_状态('发布');
        $res = $mo->where($mo->data)->orderby(' id DESC ')->rows();
        require $this->template;
    }

    /**
     * 2016-12-9 会议直播页面跳转
     */
    function live_video() {
        $account = $this->request('account');
        $token = $this->request('token');
        if (!$account or !$token) {
            $this->redirectToWeixinForOpenid();
            $token = $_SESSION['userCenter']['token'];
            $account = $_SESSION['userCenter']['id'];
        }
        if ($token) {
            if ($this->request('title')) {
                $url = sprintf(VIDEO_LIVE_URL_1, $token, $account);
            } else {
                $url = sprintf(VIDEO_LIVE_URL, $token, $account);
            }

            header("Location:$url");
        }
    }

    function live_radio_homepage() {
        $meet_id = $this->request('meet_id', '', true);
        $do = new Do会议表();
        $do->loadById($meet_id);

        $video_url_1 = $this->url('conference', 'live_video');
        $video_url_2 = $this->url('conference', 'live_video', array('title'=>'1'));
        $video_list_url = $this->url('conference', 'common_shipinList', array('meet_shipin_id' => $meet_id));
        require_once $this->template();
    }

    //首都会议 2016年5月
    function beijing_addUser(){
        $mo = new DoMeet_registration();
        if($_POST){
            $mo->set_openid($this->openId());
            $mo->set_会议id($this->request('meet_id'));
            $mo->where($mo->data)->row();
            $mo->set_name($this->request('name'));
            $mo->set_sex($this->request('sex'));
            $mo->set_zhiwei($this->request('position'));
            if($_REQUEST['position']=='护士'){
                $zhiwu=$_REQUEST['nurse'];
            }else{
                $zhiwu=$_REQUEST['Dr'];
            }
            $mo->set_zhiwu($zhiwu);
            $mo->set_email($this->request('email'));
            $mo->set_phone($this->request('phone'));
            $mo->set_idea($this->request('idea'));
            $mo->set_keshi($this->request('keshi'));
            $mo->set_work_name($this->request('work_name'));
            $mo->set_work_tel($this->request('work_tel'));
            $mo->set_work_chuanzhen($this->request('work_chuanzhen'));

            if ($mo->save()) {
                $this->successPage('报名成功', self::爱贝介绍微信文章URL);
            } else {
                $url = $this->url('conference', 'beijing_addUser');
                $this->errorPage('报名失败', $url);
            }

        }else{
            $zhiwei = array('医生','护士');
            $zhiwu = array('主任医师','副主任医师','主治医师','住院医师','其他');
            $zhiwu2 = array('初级护士','初级护师','中级主管护师','副主任护师','主任护师','其他');
            $mo->where(array('openid'=>$this->openId(),'会议id'=>$_REQUEST['meet_id']))->row();
            $meet = $mo->data;
            $meet_detail_url = $this->share('beijing_index');
            require $this->template;
        }
    }

    //上海会议报名 2016年6月
    function shanghai_addUser(){
        $url_shanghai_add = $this->url('conference', 'shanghai_addUser');
        $mo = new DoMeet_registration();
        $fo = new DoMeet_register_affiliate();
        if($_POST){
            $source = $this->request('source','weixin');
            if ($source == 'weixin'){
                $mo->set_openid($this->openId());
            } else {
                $mo->set_phone($this->request('phone'));
            }
            $mo->set_会议id($this->request('meet_id'));
            $mo->where($mo->data)->row();
            $mo->set_name($this->request('name'));
            $mo->set_source($source);
            $mo->set_sex($this->request('sex'));
            $mo->set_zhiwei($this->request('position'));
            $zhiwu = $this->request('position')=='医生'?$this->request('Dr'):$this->request('nurse');
            $mo->set_zhiwu($zhiwu);
            $mo->set_email($this->request('email'));
            $mo->set_phone($this->request('phone'));
            $mo->set_age($this->request('age'));
            $mo->set_work_name($this->request('work_name'));

            $f_id=$this->request('f_id');
            if(!empty($f_id)){
                $fo->set_id($f_id);
            }
            if(!$mo->save()){
                $this->errorPage('报名失败', $url_shanghai_add);
            }
            $reg_id=$mo->get_id();
            //省市区表
            $sql = "select REGION_NAME from dc_region where REGION_ID in (".$_REQUEST['pro2'].",".$_REQUEST['city2'].")";
            $city = "";
            $city_res=pdo()->selects($sql);
            foreach($city_res as $k=>$v){
                $city.=$v['REGION_NAME']."-";
            }
            //再次查询信息，省市不做修改，默认之前的省市
            if(empty($_REQUEST['city2'])){
                $city = $_REQUEST['city'];
            }
            //会议报名附属表
            $fo->set_is_stay($this->request('hotel'));
            $fo->set_city($city);
            $fo->set_mailing_address($this->request('mailing_address'));

            $meet_reg_id = empty($_REQUEST['meet_reg_id'])?$reg_id:$_REQUEST['meet_reg_id'];

            $fo->set_meet_reg_id($meet_reg_id);
            $fo->set_room_type($this->request('room'));
            $date=implode('-',$_REQUEST['date']);
            $fo->set_stay_time($date);
            $fo->set_postcode($this->request('postcode'));
            if(empty($_REQUEST['hotel'])){
                $fo->set_room_type(" ");
                $fo->set_stay_time(" ");
            }
            if ($fo->save()) {
                $this->successPage('报名成功', self::爱贝介绍微信文章URL);
            } else {
                $this->errorPage('报名失败', $url_shanghai_add);
            }

        }else{
            $zhiwei = array('医生','护士');
            $zhiwu = array('主任医师','副主任医师','主治医师','住院医师','其他');
            $zhiwu2 = array('初级护士','初级护师','中级主管护师','副主任护师','主任护师','其他');
            $time = array('6月15日','6月16日','6月17日','6月18日');
            $room_type = array('双人标间','单人标间');
            $mo_res = $mo->where(array('openid'=>$this->openId(),'会议id'=>$_REQUEST['meet_id']))->row();
            $fo_res = $fo->where(array('meet_reg_id'=>$mo_res->data['id']))->row();
            $city = explode("-",$fo_res->data['city']);
            $shanghai_get_areaList = $this->url('conference',"shanghai_get_areaList");
            $shanghai_get_citylist= $this->url('conference',"shanghai_get_citylist");

            $meet_detail_url = $this->share('shanghai_index');
            require $this->template;
        }
    }

    #上海会议介绍
    function shanghai_descript(){
        $meet_detail_url = $this->share('shanghai_index');
        require $this->template;
    }

    function shanghai_descript1(){
      //  $meet_detail_url = $this->share('shanghai_index');
        require $this->template;
    }

    #上海会议时间表
    function shanghai_timetables(){
        $back_url=Tools::url('conference','shanghai_index',array("meet_id"=>$_GET['meet_id']));
        $meet_detail_url = $this->share('shanghai_index');
        require $this->template;
    }

    #地区列表（上海会议报名）
    function shanghai_get_areaList()
    {
        $city = empty($_POST['id']) ? '1' : $_POST['id'];
        $sql = "select REGION_ID,REGION_NAME from dc_region where PARENT_ID=" . $city;
        $res = pdo()->selectAll($sql);
        if ($res) {
            echo json_encode($res);
        } else {
            echo "no";
        }
    }

    #城市列表（上海会议报名）
    function shanghai_get_citylist(){
       $city=$_POST['name'];
       $sql1="select REGION_ID,REGION_NAME from dc_region where REGION_NAME='".$city."'" ;
       $res1=pdo()->selectOne($sql1);
       $sql="select REGION_ID,REGION_NAME from dc_region where PARENT_ID=".$res1['REGION_ID'] ;
        $res = pdo()->selectAll($sql);
        if($res){
            echo json_encode($res);
        }else{
            echo "no";
        }
    }

    //首都会议主页
    function beijing_index(){
        $do_meet = new Do会议表();
        $mo = new DoMeet_registration();
        if(isset($_REQUEST['meet_id'])){
            $mo->set_openid($this->openId());
            $mo->set_会议id($_REQUEST['meet_id']);
            $res1 = $mo->where($mo->data)->row();
            if($res1)
            {
                $add_register=Tools::url('conference','beijing_addUser',array('meet_id'=>$_REQUEST['meet_id']));
                $state = "报名成功";
            }else{
                //报名人数
                $res = $mo->where(array('会议id'=>$_REQUEST['meet_id']))->count();
                $do_meet->where('会议id='.$_REQUEST)->row();
                if($res['num'] >= $do_meet->get_max_register()){
                    $state="报名已满";
                    $background_color=" #CCCCCC";
                }else{
                    $add_register=Tools::url('conference','beijing_addUser',array('meet_id'=>$_REQUEST['meet_id']));
                    $state="在线报名";
                }
            }

            $doUser = new Do用户();
            $doUser->set_openID($this->openId());
            $is_guanzhu = $doUser->where($doUser->data)->count();
            if (!$this->openId()) $is_guanzhu = false;
        }
        $meet_detail_url = $this->share('beijing_index');
        require $this->template;
    }

    //泉州会议主页
    function quanzhou_index(){
        $meet_shipin = new Do会议视频();
        $meet = new Do会议表();
        $state = array();
        $state['meet_id'] = $_REQUEST['meet_id'];
        $quanzhou_meet_descript_url = Tools::url('conference','quanzhou_descript',$state);
        $quanzhou_meet_timetables_url = Tools::url('conference','quanzhou_timetables',$state);

        //判断是否已有会议视频
        $meet_shipin_url = $this->is_shipin($_REQUEST['meet_id']);


        $qunliao_url = $this->url('group','chat',$state);// $this->url_linhe('websocket_qun',$state);
        $quanzhou_qun = $this->url_linhe('agent_manages',$state);
        //会议线上讨论组
        $qun_res = $this->check_group($_REQUEST['meet_id']);
        $qun_res['id'] = isset($_GET['groupId'])?$_GET['groupId']:$qun_res['id'];
        require $this->template;
    }

   //泉州会议简介
    function quanzhou_descript(){
        $meet_detail_url = $this->share('quanzhou_index');
        require $this->template;
    }

    //泉州会议议程
    function quanzhou_timetables(){
        $back_homepage_url = Tools::url('conference','quanzhou_index',array('meet_id'=>$_REQUEST['meet_id']));
        $meet_detail_url = $this->share('quanzhou_index');
        require $this->template;
    }

    //海南会议--主页
    function  hainan_index(){
        $do_meet = new  Do会议表();
        $do_meet->set_id($_GET['meet_id']);
        $do_meet->fields('图片log')->where($do_meet->data)->row();
        $报名_url = $this->url_linhe('AddMeet_users');
        $expert_des_url = "http://mp.weixin.qq.com/s?__biz=MzI3NjE2OTU3NA==&mid=403765788&idx=1&sn=6ce0533487eb004abe78749bbc43d02d&scene=1&srcid=0317e7htSJdKF9HbKNdDhe4s#wechat_redirect";
        $meet_des_url = "http://mp.weixin.qq.com/s?__biz=MzI3NjE2OTU3NA==&mid=403764438&idx=1&sn=e3e2e7609ebff14bb5a704f827dd0883&scene=1&srcid=03178ikJHnBwYi22lXjO6utC#wechat_redirect";
        $timetale_url = "http://mp.weixin.qq.com/s?__biz=MzI3NjE2OTU3NA==&mid=404099426&idx=1&sn=54216bdf97a2e54b1c326ed09e1243a9&scene=1&srcid=03311UqL0vjEzhbLmEwrHutw#wechat_redirect";

        $meet_shipin_url = $this->is_shipin($_REQUEST['meet_id'],'hainan_index');

        require $this->template;
    }

    //上海会议主页
    function shanghai_index(){

        $meet_shipin = new Do会议视频();
        $meet = new Do会议表();
        $state = array();
        $state['meet_id'] = $_REQUEST['meet_id'];

        $qunliao_url = $this->url('group','chat',$state);//$this->url_linhe('websocket_qun',$state);
        $meet_reg_url = Tools::url('conference','shanghai_addUser',array('meet_id'=>$_REQUEST['meet_id']));
        $meet_descript_url = Tools::url('conference','shanghai_descript',array('meet_id'=>$_REQUEST['meet_id']));
        $meet_timetables_url = Tools::url('conference','shanghai_timetables',array('meet_id'=>$_REQUEST['meet_id']));

        // 会议线上讨论组
        $qun_res = $this->check_group($_REQUEST['meet_id']);
        $qun_res['id'] = isset($_GET['groupId'])?$_GET['groupId']:$qun_res['id'];
        //判断是否已有会议视频
        $meet_shipin_url = $this->is_shipin($_REQUEST['meet_id']);
        require $this->template;
    }

    //北大会议主页
    function  beida_index(){
        $do_meet = new  Do会议表();
        $do_meet->set_id($_GET['meet_id']);
        $do_meet->fields('图片log')->where($do_meet->data)->row();
        $meet_des_url = "http://mp.weixin.qq.com/s?__biz=MzI3NjE2OTU3NA==&mid=504502672&idx=1&sn=327c402ebb2090c29685dca1d3211d79&scene=1&srcid=0418C1wOEX5lct0LwyTM4KgS#rd";
        $timetables_url = "http://mp.weixin.qq.com/s?__biz=MzI3NjE2OTU3NA==&mid=504502676&idx=1&sn=b08eb9907465a8fafa38b5eb74c343a5&scene=1&srcid=0418EsYRNjpbqVrIFSFTGXjX#rd";
        $shipin_list_url = $this->url('conference','common_shipinList');
        $reg_beida_url = $this->url_linhe('AddMeet_users_beida');
        require $this->template;
    }

    //主页 第六次新生儿科医师大会--北京会议中心
    function xinshenger_index(){
        $do_meet = new  Do会议表();
        $do_meet->set_id($_GET['meet_id']);
        $do_meet->fields('图片log')->where($do_meet->data)->row();
        $parm = array('meet_id'=>$_REQUEST['meet_id']);
        $qunzu_list_url = $this->url('conference','xinshenger_qunzu',$parm);
        $shipin_list_url = $this->url('conference','xinshenger_shipin',$parm);
        require $this->template;
    }

    //群组列表 第六次新生儿科医师大会--北京会议中心
    function  xinshenger_qunzu(){
        $do_meet = new  Do会议表();
        $do_meet->set_id($_GET['meet_id']);
        $do_meet->fields('图片log')->where($do_meet->data)->row();

        $meet_detail_url = $this->share('xinshenger_index');
        $qunliao_url = $this->url('group','chat');// $this->url_linhe('websocket_qun');
        $agent_url = $this->url_linhe('agent_manages');
        if($_GET['父id']) $父id =$_GET['父id'];else  $父id='1';
        require $this->template;
    }

    //视频列表 第六次新生儿科医师大会--北京会议中心
    function xinshenger_shipin(){
        $do_meet = new  Do会议表();
        $do_meet->set_id($_GET['meet_id']);
        $do_meet->fields('图片log')->where($do_meet->data)->row();

        $meet_detail_url = $this->share('xinshenger_index');
        $group_shipin_url = $this->url('group','webSocket_video');//$this->url_linhe('websocket_shipin');
        require $this->template;
    }


    //公共视频列表页
    function  common_shipinList(){
        $do_meet_shipin = new Do会议视频();
        $do_meet = new Do会议表();
        $quanliao_shipin_url = $this->url('group','webSocket_video');//$this->url_linhe('websocket_shipin');
        $do_meet_shipin->set_meet_id($_REQUEST['meet_shipin_id']);
        $do_meet->set_id($_REQUEST['meet_shipin_id']);
        $do_meet_shipin->leftJoin($do_meet,'b','a.meet_id=b.id');
        $res = $do_meet_shipin->fields('a.*,b.图片log')->where($do_meet_shipin->data)->orderby(" id DESC ")->rows();
        $meet_one = $do_meet->fields('name,下一步,图片log')->where($do_meet->data)->row();
        $meet_detail_url = $this->share($meet_one->data['下一步'],$_REQUEST['meet_shipin_id']);

        require $this->template;
    }

    //无视频是的准备也
    function  common_shipinReady(){
        $back_url = Tools::url('conference',$_REQUEST['back'],array("meet_id"=>$_REQUEST['meet_shipin_id']));
        require $this->template;
    }

    //广州会议主页
    function guangzhou_index(){
        $meet_shipin = new Do会议视频();
        $meet = new Do会议表();
        $state = array();
        $state['meet_id'] = $_REQUEST['meet_id'];
        $guangzhou_meet_descript_url = Tools::url('conference','guangzhou_descript',$state);
        $guangzhou_meet_timetables_url = Tools::url('conference','guangzhou_timetables',$state);

        //判断是否已有会议视频
        $meet_shipin_url = $this->is_shipin($_REQUEST['meet_id']);
        $qunliao_url = $this->url('group','chat');// $this->url_linhe('websocket_qun',$state);

        $qun_res=$this->check_group($_REQUEST['meet_id']);
        $qun_res['id'] = isset($_GET['groupId'])?$_GET['groupId']:$qun_res['id'];
        require $this->template;
    }

    //广州会议课程表
    function guangzhou_timetables(){
        $back_homepage_url = $this->url('conference','guangzhou_index',array('meet_id'=>$_REQUEST['meet_id']));
        $meet_detail_url = $this->share('guangzhou_index');
        require $this->template;
    }

    //广州会议简介
    function guangzhou_descript(){
        $meet_detail_url = $this->share('guangzhou_index');
        require $this->template;
    }


    //湖南常德会议主页
    function  changde_index(){
        $parm = array('meet_id'=>$_REQUEST['meet_id']);
        $meet_shipin_url = $this->is_shipin($_REQUEST['meet_id']);

        $changde_meet_timetables_url = $this->url('conference','changde_timetables',$parm);
        require $this->template;
    }

    //湖南常德会议议程
    function changde_timetables(){
        $meet_detail_url = $this->share('changde_index');
        $back_url = $this->url('conference','changde_index',array('meet_id'=>$_REQUEST['meet_id']));
        require $this->template;
    }

    //广州保健协会论坛--主页 2016-7-8
    function  xinsr_guangz_index(){
        $state = array();
        $state['meet_id'] = $_REQUEST['meet_id'];

        $qunliao_url = $this->url('group','chat',$state);//$this->url_linhe('websocket_qun',$state);
        $qun_res=$this->check_group($_REQUEST['meet_id']);
        $qun_res['id'] = isset($_GET['groupId'])?$_GET['groupId']:$qun_res['id'];

        $meet_shipin_url = $this->is_shipin($_REQUEST['meet_id']);
        $bj_meet_descript_url = $this->url('conference','xinsr_guangz_descript',$state);
        $bj_meet_timetables_url = $this->url('conference','xinsr_guangz_timetables',$state);
        require $this->template;
    }

    //广州保健协会论坛--介绍  2016-7-8
    function  xinsr_guangz_descript(){
        $meet_detail_url = $this->share('xinsr_guangz_index');
        require $this->template;
    }

    //广州保健协会论坛--会议安排 2016-7-8
    function xinsr_guangz_timetables(){

        $meet_detail_url = $this->share('xinsr_guangz_index');
        $back_url = $this->url('conference','xinsr_guangz_index',array('meet_id'=>$_REQUEST['meet_id']));
        require $this->template;
    }

    //广州 第四届全国新生儿脑损伤诊治新进展学习班 2016-7-28
    function  xinsr_nao_index(){
        $state = array();
        $state['meet_id'] = $_REQUEST['meet_id'];

        $qunliao_url = $this->url('group','chat',$state);//$this->url_linhe('websocket_qun',$state);
        $qun_res=$this->check_group($_REQUEST['meet_id']);
        $qun_res['id'] = isset($_GET['groupId'])?$_GET['groupId']:$qun_res['id'];

        $meet_shipin_url = $this->is_shipin($_REQUEST['meet_id']);
        $xinsr_nao_descript_url = $this->url('conference','xinsr_nao_descript',$state);
        $xinsr_nao_timetables_url = $this->url('conference','xinsr_nao_timetables',$state);
        require $this->template;
    }

   //广州 第四届全国新生儿脑损伤诊治新进展学习班 2016-7-28--介绍
    function  xinsr_nao_descript(){

        $meet_detail_url = $this->share('xinsr_nao_index');
        require $this->template;
    }

    //  //广州 第四届全国新生儿脑损伤诊治新进展学习班 2016-7-28--会议安排
    function xinsr_nao_timetables(){
        $back_url = $this->url('conference','xinsr_nao_index',array('meet_id'=>$_REQUEST['meet_id']));
        $meet_detail_url = $this->share('xinsr_nao_index');
        require $this->template;
    }

    //会议主页--改进
    function  common_homepage(){
        $do_meet = new Do会议表();
        $do_meet_h = new  DoMeet_columnlist();

        $qun_res=$this->check_group($_REQUEST['meet_id']);

        $qun_res['id'] = isset($_GET['groupId'])?$_GET['groupId']:$qun_res['id'];

        $state = array();
        $state['meet_id'] = $_REQUEST['meet_id'];
        $state['groupId'] = $qun_res['id'];

        $qunliao_url = $this->url('group','chat',$state);// $this->url_linhe('websocket_qun',$state);
        $meet_shipin_url = $this->is_shipin($_REQUEST['meet_id']);
        $do_meet->set_id($_REQUEST['meet_id']);
        $meet_one = $do_meet->fields("name,图片log,会议报名")->where($do_meet->data)->row();
        $do_meet_h->set_meet_id($_REQUEST['meet_id']);
        $column = $do_meet_h->where($do_meet_h->data)->rows();
        $meet_reg_url = $this->url('conference',$meet_one->data['会议报名'],array('meet_id'=>$_REQUEST['meet_id']));
        $descript_url = $this->url('conference','common_content',array('meet_id'=>$_REQUEST['meet_id']));
        require $this->template;
    }

    //会议栏目通知--改进
    function common_content(){
        $do_meet = new Do会议表();
        $do_column = new DoMeet_columnlist();
        $do_column->set_id($_REQUEST['column_id']);
        $do_column->where($do_column->data)->row();

        $do_meet->set_id($do_column->get_meet_id());
        $meet_one = $do_meet->where($do_meet->data)->row();
        $meet_detail_url = $this->share($do_meet->get_下一步(),$do_meet->get_id());
        require $this->template;
    }



    //会议线上讨论组：判断用户是否已是群成员
    function check_group($父id=null){

        $where_group = " AND b.`父id` = '".$父id."' ";
        $sql="SELECT b.`群名称`,b.id,( SELECT COUNT(d.id) FROM `群聊` d WHERE d.`时间`>(SELECT c.`最后在线时间` FROM `群离线` c WHERE  c.`用户id` = a.`用户id` AND c.`群id`=a.`群id` )  AND   d.`群id`=a.`群id`) AS `未读条数`,(SELECT COUNT(e.id) FROM `群成员` e WHERE e.`群id`=a.`群id` AND e.`角色` !='未审核') AS `成员数` FROM `群成员` a  LEFT JOIN `群详情` b on(a.`群id`= b.id) WHERE a.`用户id`=".$_SESSION['vo用户数据']['id']." AND a.`角色` !='未审核' ".$where_group." ;";
        $qun_res = pdo()->selectOne($sql);
        return $qun_res;

    }


    //判断是否有视频
    function is_shipin($meet_id,$back_index=""){

        $meet = new Do会议表();
        $meet_shipin = new Do会议视频();
        //判断是否已有会议视频
        $meet_shipin->set_meet_id($meet_id);
        $meet->set_id($meet_id);
        $meet->where($meet->data)->row();
        $meet_shipin->fields('a.*,b.*')->where($meet_shipin->data);
        $res=$meet_shipin->leftJoin($meet,'b')->on('a.meet_id=b.id')->rows();

        $parm = array('meet_shipin_id'=>$meet_id);
       if(empty($back_index)){
          $back_index = array('back'=>$meet->get_下一步(),'meet_shipin_id'=>$meet->get_id());
       }else{
           $back_index = array('back'=>$back_index);
       }


        if($res){
            return Tools::url('conference','common_shipinList',$parm);
        }else{
            return Tools::url('conference','common_shipinReady',$back_index);
        }
    }

    //会议分享
    function share($page,$meet_id=""){
        $do会议表 = new Do会议表();
        $do会议表->set_id($_REQUEST['meet_id']);
        $do会议表->where($do会议表->data)->row();
        $meet_id = empty($meet_id)?$_REQUEST['meet_id']:$meet_id;
        $state = array();
        $state['meet_id'] = $meet_id;
       // $state['max_register'] = $do会议表->get_max_register();
        return Tools::url('conference',$page,$state);
    }


}